home *** CD-ROM | disk | FTP | other *** search
-
-
-
- KWS V1.30 Copyright (c) 1991-1993 Copy Con Incorporated Page 1
-
-
- DESCRIPTION
- -----------
- KWS (KeyWord Search) is a small, fast program that performs logical
- AND/OR/NOT searches for keywords within one or more text or binary
- files. KWS has many features and options, including:
-
- * Prefix, suffix, and whole word searches.
- * Case-sensitive searches.
- * Adjustable fuzzy searches.
- * Subdirectory searches.
- * Highlight keywords in bold onscreen.
- * Display line numbers or file offset position.
- * Display total lines per file and per search.
- * Wildcard filename searches.
- * Read data from standard input.
- * Read/write filenames from/to a file list.
- * Search hidden and system files.
- * Stop search after a specified number of matches.
- * Smart pause that detects your screen size.
- * Adjustable window size for searching groups of lines.
- * Display files onscreen while routing to a device or file.
- * Strip control characters from text files.
- * Search/convert text files created on other platforms.
- * Runs on any PC compatible using DOS 2.0 or higher.
-
-
- DISCLAIMER
- ----------
- KWS is distributed on an "AS IS" basis without warranty, expressed or
- implied. Considerable testing effort has been expended, but the user
- is advised to check the program's suitability before relying on it.
- The user assumes full risk as to the results of using this program. In
- no event shall the author be liable for any incidental or
- consequential damages arising from the use, or inability to use this
- program.
-
-
- REGISTRATION
- ------------
- The unregistered version of KWS is freely distributable and fully
- functional, and may be used for a 30-day trial period. If you plan to
- continue using KWS, you are obligated to pay the modest registration
- fee of $20. Registered users will receive an individually serialized
- nag-free version of KWS, a free upgrade, and $5 subsequent upgrades.
-
- All registration information is contained in the KWS.REG file. If that
- file is missing, register by sending your name and address (please
- print), and a check or money order for $20 to:
-
- Copy Con Incorporated
- PO Box 23255
- Baltimore MD 21203-5255
-
- Please specify 3.5" or 5.25" diskette. MD residents add 5% sales tax.
- Thank you for supporting Shareware.
-
-
-
- KWS V1.30 Copyright (c) 1991-1993 Copy Con Incorporated Page 2
-
-
- OPERATION
- ---------
- KWS is activated from the command line, using the format
-
- KWS [@]filename search_string[...] [options]
-
- Parameters surrounded by [brackets] are optional.
-
- The @ symbol, if used, must be directly followed by the name of a text
- file containing valid filespecs; the files to be searched will be read
- from that file list. (File lists can be created with KWS using the /M
- option; see OPTIONS.)
-
- If the @ symbol is not used, the filename is the filespec to be
- searched. Wildcards are optional. (For a description of wildcards and
- filespecs, see your DOS manual.)
-
- Each search string is comprised of keywords separated by semicolons.
- At least one keyword from each search string must be present in a
- given line for it to be displayed; for example,
-
- KWS allfiles.lst fixed;hard disk;drive
-
- will display the lines in file ALLFILES.LST that contain either words
- FIXED or HARD (or both), and also contain either words DISK or DRIVE.
-
- If a search string contains a keyword with embedded spaces, the entire
- search string must be enclosed in quotes; for example,
-
- KWS temp.bat "del *;era *"
-
- will search TEMP.BAT for the phrase "del *" or "era *" (without the
- quotes).
-
- A logical 'NOT' search can be conducted by preceding a keyword with
- an exclamation (!) character; for example,
-
- KWS stuff.txt this !that
-
- will display the lines in STUFF.TXT that contain the word THIS and not
- the word THAT. If you wish to search for an exclamation as the first
- (or only) character of a keyword, use two in a row; for example,
-
- KWS stuff.txt this !!that
-
- will display lines that contain both words THIS and !THAT. Exclamation
- characters inside or following keywords (as in " HEY! " or " What!? ")
- do not have to be doubled.
-
- A fuzzy search can be conducted by preceding a keyword with a tilde
- (~) character; lines with words that are similar to the keyword will
- be displayed. This option is useful if you aren't sure of a keyword's
- correct spelling, or if a keyword may be spelled incorrectly in the
- files to be searched. for example,
-
-
-
- KWS V1.30 Copyright (c) 1991-1993 Copy Con Incorporated Page 3
-
-
- OPERATION (continued)
- ---------------------
-
- KWS gnu.txt ~copyrite
-
- will display lines with words similar to COPYRITE. (The similarity
- percentage can be adjusted with the /F option; see OPTIONS.) If you
- wish to combine a fuzzy search with a logical 'NOT' search, use the
- 'NOT' character before the tilde (as in " !~THE "). Fuzzy searches
- cannot be combined with prefix/suffix/whole word searches (described
- below).
-
- Whole word searches can be conducted by putting underscore (_)
- characters before and after the keyword; for example,
-
- KWS files.lst _c_ source
-
- will display lines in FILES.LST that contain a lone 'C' and the word
- SOURCE. Similarly, prefixes can be searched for by putting an
- underscore before a keyword, and suffixes can be searched for by
- putting an underscore after a keyword. If you wish to search for an
- underscore as the first or last (or only) character of a keyword, use
- two underscores in a row, as with the logical 'NOT' exclamation
- character above. If you wish to combine a prefix/whole word search
- with a logical 'NOT' search, use the 'NOT' character before the
- underscore (as in " !_c_ "). Prefix/suffix/whole word searches cannot
- be combined with fuzzy searches (described above).
-
- Up to 10 search strings are allowed, with up to 10 keywords per
- string.
-
-
- OPTIONS
- -------
- Options can appear anywhere on the command line after the filename.
- They can be in any order, and are not case-sensitive. Options can be
- separated by spaces (/L3 /P /T) or strung together (/L3/P/T or /L3PT).
-
- Option Description
-
- /A When this option is used with the /L (line number or offset)
- option, all binary files will automatically be shown with
- hexadecimal file offsets, as if /L0 and /X were used.
-
- /B This option makes the keywords stand out from the rest of the
- displayed line. When using this option, output cannot be
- routed using DOS redirection; use the /O option instead.
-
- /C Search will be case-sensitive. Case-sensitive searches are
- approximately 20% faster than case-insensitive searches.
-
- /D Control characters (ASCII value less than 32) within text
- files will be replaced with spaces before being viewed or
- routed.
-
-
-
- KWS V1.30 Copyright (c) 1991-1993 Copy Con Incorporated Page 4
-
-
- OPTIONS (continued)
- -------------------
- /E The command line will be echoed as the first output line.
- Useful mainly with redirected files to avoid repetition, and
- for testing batch files.
-
- /Fn This option controls the similarity percentage for fuzzy
- searches. Similarity defaults to 65 percent, and can be
- adjusted from 0 (display almost every line) to 100 (display
- exact matches).
-
- /H Hidden and/or system files will also be searched.
-
- /Kc Change the keyword separator charactor from a semicolon to
- the specified character. This option may be needed to pass
- multiple keyword parameters to a batch file (as some versions
- of DOS remove semicolons from batch parameters), or if a
- semicolon is part of a keyword to be searched.
-
- /L[n] Line numbers or file offset position will be displayed with
- output. If the specified width begins with a zero, then the
- file offset will be displayed; otherwise, line numbers will
- be displayed. If no width is specified, the numbers will be
- left-justified, with a colon between the number and the text;
- otherwise, the numbers will be right-justified and zero-
- padded to the left, followed by the colon and text. If the
- specified width is too small for a number to fit, the number
- will NOT be truncated.
-
- /M[n] Stop searching after n matches per file. /M alone will cause
- KWS to print only the filenames of successful searches, and
- these can be redirected to a file to be used as a file list.
-
- /Ofn Route output to the specified device/filename. Output will be
- in addition to, not instead of, output displayed onscreen. To
- route output without viewing, use DOS redirection instead of
- this option (see your DOS manual for details). Do not append
- other options on to the end of this option.
-
- /P Pause between each screen of text. KWS will autodetect your
- screen size, and pause accordingly. While paused, pressing
- the 'C' key will display the current and any remaining files
- continuously. Pressing the Escape key while paused will skip
- the current file and go on to the next. This option will be
- inactive when the /R option is used.
-
- /R Instead of reading from text files, KWS will act as a filter
- or pipe (input is taken from an input device or from another
- program's output). When in this mode, the /P, /V, and /W
- options will be inactive. Do not specify a filename when
- using this option.
-
- /S Subdirectories will also be searched. This option is valid
- only with wildcard and file list searches.
-
-
-
- KWS V1.30 Copyright (c) 1991-1993 Copy Con Incorporated Page 5
-
-
- OPTIONS (continued)
- -------------------
- /T Display total lines found per file. For wildcard and file
- list searches, a grand total will also be displayed.
-
- /V If KWS cannot determine if a file is binary or text, text
- will be assumed; using this option will tell KWS to treat all
- files as binary. This option is inactive when using the /R
- option; standard input is always assumed to be text.
-
- /Wn Normally, all keywords must be on the same line for the line
- to be printed; use this option to look at more than one line
- at a time. If all keywords are found within the specified
- window size (maximum of 32767 lines), then the lines will be
- printed, starting with the first line to contain a keyword,
- and ending with the last line to contain a keyword. This
- option will be inactive when searching a binary file or when
- using the /R option.
-
- /X When this option is used with the /L option, line numbers and
- offset positions will be displayed in hexadecimal format
- instead of decimal.
-
-
- EXAMPLES
- --------
- KWS catalog.lst dvorak keyboard /p
- will take the lines in file CATALOG.LST that contain the words
- DVORAK and KEYBOARD, and display them one screen at a time.
-
- KWS catalog.lst arc;lzh shell /l5 /oprn
- will take the lines in file CATALOG.LST that contain either ARC or
- LZH, and also contain SHELL, and display them onscreen with line
- numbers, while sending them to the printer (PRN).
-
- KWS allfiles.lst /c !.ZIP >nozip.lst
- will make a file called NOZIP.LST, which will contain all of the
- lines in ALLFILES.LST that do NOT contain the word .ZIP in caps.
- Output will not be seen onscreen.
-
- KWS \dl\*.lst MIDI /ptc
- will search all .LST files in the DL directory for the word MIDI in
- capital letters, and displays the filenames and lines onscreen, one
- screen at a time, with totals for each file.
-
- KWS *.bak _the_
- will search the backup files for lines that contain the word THE,
- but will not display them if THE is part of another word (as in
- THESIS or OTHER).
-
- KWS temp.bak _the_;!_the_ /b
- will display every line in TEMP.BAK, hilighting any occurrance of
- the word THE.
-
-
-
- KWS V1.30 Copyright (c) 1991-1993 Copy Con Incorporated Page 6
-
-
- EXAMPLES (continued)
- --------------------
- KWS c:\*.bat _del;_era /s/h
- will search all of the batch files on the C: drive, including those
- with their hidden and/or system attributes set, to see if any of
- them delete/erase files.
-
- dir | KWS -92 /r
- pipes the output from the DIR command into KWS, which will display
- the directory entries from 1992.
-
- KWS ; /r /l3 <one.txt >two.txt
- creates file TWO.TXT which is a duplicate of file ONE.TXT, except
- that TWO.TXT will have 3-digit line numbers. (A search for the
- keyword separator will find every line.)
-
- KWS unix.man ; >unix.doc
- converts a Unix format text file (LF delimited) into a DOS format
- text file (CR/LF delimited). KWS can also read CR delimited files.
-
- KWS *.doc ~copyrite /f70b
- will search the .DOC files for words similar to COPYRITE, hilighting
- any close calls.
-
- KWS *.doc ~copyrite !1993 /f70b
- will display the same lines as the above example, except for lines
- containing the word 1993.
-
- KWS allfiles.lst _c_;assem;asm src;source /pb
- will display all lines in ALLFILES.LST that have to do with C or
- assembler source code. Keywords will be in bold, and output will be
- paused after each screen.
-
- KWS allfiles.lst _c_;assem;asm src;source !c++ /pb
- will display the same as above, except C++ files will not be shown.
-
- KWS \dl\*.zip .DOC /cm
- looks inside of ZIP files for any .DOC files, displaying the ZIP
- filename if any are found.
-
- KWS \*.com ; /hal6p /od:com.txt
- examines all (even hidden/system) .COM files in the root directory,
- using hex file offsets 6 characters wide, pausing at each screen,
- while also sending output to file COM.TXT on the D: drive.
-
- KWS p_simon.txt /cbw2 Ms;Miss;Mrs Robinson
- will do a case-sensitive search for Ms or Miss or Mrs Robinson, and
- will display matches in bold, as long as Ms;Miss;Mrs is no more than
- one line's distance from Robinson.
-
- KWS kws.doc ; /pdolpt2
- displays this file, one screen at a time, removing embedded form-
- feed characters, while also sending output to printer LPT2.
-
-
-
- KWS V1.30 Copyright (c) 1991-1993 Copy Con Incorporated Page 7
-
-
- EXAMPLES (continued)
- --------------------
- KWS c:\*.bat ; /sm >filelist.txt
- will create a file named FILELIST.TXT containing the names of all of
- the batch files on the C: drive. This file is used in the next
- example.
-
- KWS @filelist.txt label "if %;goto"
- will search the filenames in FILELIST.TXT, and display lines in
- those files that contain the word LABEL and either the word GOTO or
- the phrase "IF %" (without the quotes). Note that this example has
- only two search strings, not three; if any words in a search string
- contain spaces, then the entire search string must be in quotes.
-
-
- RETURN CODES
- ------------
- The DOS errorlevel will be set if a search is unsuccessful:
-
- Level Description
-
- 1 Invalid command line options
-
- 2 None of the files contain the search string(s)
-
- 3 Ctrl-Break interrupt
-
- 4 Invalid directory specified
-
- 5 No files match filespec
-
- 6 Unable to open output file
-
-
- SUPPORT
- -------
- If you have questions, comments, suggestions, bug reports, et cetera,
- feel free to contact me by one of the following methods:
-
- 1: By modem at The Programmer's Corner (301-596-7692 or 410-995-6873).
- Send a message to RD Thomas in the Shareware or General conference,
- and check back in a couple of days for a reply.
-
- 2: On a BBS that carries the RIME Shareware conference (RD Thomas,
- node ->1520). Allow at least one week for a reply.
-
- 3: By US Mail at the address given on the first page. If you would
- like a reply, please include a self-addressed, stamped envelope.
-
- Looking forward to hearing from you.
-
-
- To print this document, type "COPY KWS.DOC PRN" at the DOS prompt.
-